Skip to content

fix: resolve duplicate test declarations in server package#3098

Merged
lpcox merged 2 commits intomainfrom
fix/duplicate-test-declarations-main
Apr 3, 2026
Merged

fix: resolve duplicate test declarations in server package#3098
lpcox merged 2 commits intomainfrom
fix/duplicate-test-declarations-main

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented Apr 3, 2026

Problem

make lint fails on main with:

vet: internal/server/session_test.go:144:6: newMinimalUnifiedServer redeclared in this block

Two recently merged branches both added declarations that conflict:

  • session_test.go: newMinimalUnifiedServer(t) and TestRequireSession
  • ensure_guard_initialized_test.go: newMinimalUnifiedServer(cfg) (different signature)
  • unified_test.go: TestRequireSession

Fix

Rename the session_test.go declarations to avoid conflicts:

  • newMinimalUnifiedServernewMinimalUnifiedServerForSessionTest
  • TestRequireSessionTestRequireSession_SessionManagement

All tests pass with make agent-finished.

Rename redeclared newMinimalUnifiedServer and TestRequireSession in
session_test.go to avoid vet errors caused by merge conflicts with
unified_test.go and ensure_guard_initialized_test.go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 3, 2026 05:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Resolves go vet/lint failures in the internal/server test package caused by duplicate top-level test/helper declarations introduced by recent merges, by renaming the conflicting symbols in session_test.go.

Changes:

  • Renamed newMinimalUnifiedServer(t) to newMinimalUnifiedServerForSessionTest(t) in session_test.go.
  • Renamed TestRequireSession to TestRequireSession_SessionManagement to avoid colliding with another test of the same name.
Comments suppressed due to low confidence (1)

internal/server/session_test.go:234

  • The doc comment above this test still says TestRequireSession, but the test function was renamed to TestRequireSession_SessionManagement. Please update the comment to avoid confusion and keep go doc output accurate.
// TestRequireSession verifies that requireSession auto-creates a new Session
// the first time a session ID is seen and reuses the same Session on subsequent calls.
func TestRequireSession_SessionManagement(t *testing.T) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lpcox lpcox merged commit 54ce310 into main Apr 3, 2026
13 checks passed
@lpcox lpcox deleted the fix/duplicate-test-declarations-main branch April 3, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants